import request from './request'

// 分页查询岗位
export const getJobPage = (data) => {
  return request({
    url: '/user/jobInfo/page',
    method: 'post',
    data: data
  })
}

// 查询岗位列表
export const getJobList = (params) => {
  return request({
    url: '/user/jobInfo/list',
    method: 'get',
    params: params
  })
}

// 添加岗位
export const addJob = (data) => {
  return request({
    url: '/user/jobInfo',
    method: 'post',
    data
  })
}

// 编辑岗位
export const editJob = (data) => {
  return request({
    url: `/user/jobInfo`,
    method: 'put',
    data
  })
}

// 删除岗位
export const deleteJob = (id) => {
  return request({
    url: `/user/jobInfo/${id}`,
    method: 'delete'
  })
}

// 修改岗位权限
export const updateJobPerm = (data) => {
  return request({
    url: `/user/jobInfo/updatePerm`,
    method: 'post',
    data
  })
}